package _15define._04Test;

public class Test {
    public static void main(String[] args) {
        Creator ic=(String name,int age)->new Person(name,age);
        Person person=ic.create("老汤",25);
        System.out.println(person.name);
        Creator ic2=Person::new;
        Person person2=ic2.create("小汤",15);
        System.out.println(person2.age);
    }
}
class Person {
    String name;
    int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
interface Creator {
    Person create(String a,int b);
}
